-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[HLSL][RootSignature] Audit RootSignatureParser
diagnostic production
#147800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+558
−77
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7d8fa5d
to
70448a3
Compare
6 tasks
joaosaffran
approved these changes
Jul 11, 2025
Icohedron
approved these changes
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me.
- It has been noted more than once that this diagnostic is confusing and misleading. It can be more concise
the order of the parameters is switched as opposed to either and this was not caught in the unit tests
70448a3
to
8e55607
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr audits the diagnostics produced in
RootSignatureParser
diagnostics.First, it has been noted more than once that the current
diag::err_hlsl_unexpected_end_of_params
is not direct and can be misleading. For instance, here and here.This pr address this by removing this diagnostic and replacing it with a more direct
diag::err_expected_either
. However, doing so removes the nuance between the case where it is a missing comma and when it was an invalid parameter.Hence, we introduce the
diag::err_hlsl_invalid_token
for the latter case, which does so in a direct way. Further, we can apply the same diagnostic to the parsing of parameter values.As part of this, we see that there was a test gap in testing the diagnostics produced from
diag::err_expected_after
and for the parsing of enum/flag values. As such, these are also addressed here to provide sufficient unit/sema test coverage.diag::err_hlsl_unexpected_end_of_params
inRootSigantureParser
diag::err_hlsl_invalid_token
to provide a direct diagnosticdiag::err_hlsl_invalid_token
ordiag::err_expected_either
accordinglyHLSLRootSignatureParserTest
to account for diagnostic changesHLSLRootSignatureParserTest
for enum/flag diagnosticsRootSignatures-err
for enum/flag diagnosticsdiag::err_expected_after
and add test to demonstrate usageResolves: #147799